package com.sxx.beautifulcity.database;

import com.sxx.beautifulcity.entity.greendao.VillageDaoEntity;
import com.sxx.beautifulcity.entity.greendao.VillageDaoEntityDao;

import java.util.List;

/**
 * Created by dllo on 15/11/4.
 */
public class VillageHelper {
    private DaoSingleton instance = DaoSingleton.getInstance();
    private VillageDaoEntityDao villageDao;

    public VillageHelper (){
        this.villageDao = instance.getVillageDao();
    }
    public void saveVillageList(List<VillageDaoEntity> daoEntities){
        villageDao.insertInTx(daoEntities);
    }
    public void deleteVillaegList(){
        villageDao.deleteAll();
    }
    public List<VillageDaoEntity> queryAllVillage(){
        return villageDao.loadAll();
    }
}
